import 'package:flutter/widgets.dart';

class PPUIKitUtils {
  /// SafeArea的padding
  static EdgeInsets safeAreaPadding(BuildContext context) {
    final MediaQueryData data = MediaQuery.of(context);
    return data.padding;
  }

  /// SafeArea的顶部高度
  static double safeAreaTopHeight(BuildContext context) {
    final MediaQueryData data = MediaQuery.of(context);
    return data.padding.top;
  }

  /// 判空
  static bool isEmpty(Object? obj) {
    if (obj is String) {
      return obj.isEmpty;
    }
    if (obj is Iterable) {
      return obj.isEmpty;
    }
    if (obj is Map) {
      return obj.isEmpty;
    }
    return obj == null;
  }
}
